<template>
	<div>
		<el-form :model="form" ref="form" label-width="100px">
			<el-form-item label="班级：" style="width: 300px;">
				<el-select placeholder="班级" v-model="form.classeNum">
					<el-option v-for="item in classeEnum" :key="item.id" :value="item.id" :label="item.qtype">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="试卷名称:" style="width: 300px;">
				<el-input v-model="form.paperName"></el-input>
			</el-form-item>
			<el-form-item label="题目类型：" style="width: 300px;">
				<el-checkbox-group v-model="form.questionType">
				  <el-checkbox v-for="item in questionEnum" :label="item" :key="item.id">{{item.qtype}}</el-checkbox>
				</el-checkbox-group>
			</el-form-item>
			
			<el-form-item label="题目个数：" style="width: 300px;" v-if="form.questionType.length!=0">
				   <el-form-item :label="value.qtype+':'"
				   v-for="(value,index,key) in form.questionType" :key="index" style="margin-bottom: 10px;">
				     <el-input-number v-model="value.num"
					  label="描述文字"></el-input-number>
				   </el-form-item>
				    
		    </el-form-item>
								
			</el-form-item>
			
			<el-form-item label="组卷方式:" style="width: 300px;">
				<div style="display: flex;">
				<el-button type="primary" @click="autoGenerator">自动组卷</el-button>
				<el-button type="danger" @click="manualGenerator">手动组卷</el-button>
				</div>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				num:'',
				questionEnum:[
					{
						id:'1',
						qtype:'单选题',
						num:''
					},
					{
						id:'2',
						qtype:'多选题',
						num:''
					}
					
				],
				subjectEnum: [{
						subjectId: '1',
						subjectIcon: '',
						subjectName: 'java基础阶段'
					},
					{
						subjectId: '2',
						subjectIcon: '',
						subjectName: 'java web阶段'
					},
					{
						subjectId: '3',
						subjectIcon: '',
						subjectName: 'java高级课程'
					},
					{
						subjectId: '4',
						subjectIcon: '',
						subjectName: '前端新技术'
					},
					{
						subjectId: '5',
						subjectIcon: '',
						subjectName: 'java新技术'
					}
				],
				classeEnum: [{
						id: '1',
						qtype: 'java35'
					},
					{
						id: '2',
						qtype: 'java36'
					}
				],
				form: {
					classeNum: '',
					paperName:'',
					questionType:[]
				},
				
			}
		},
		methods:{
			autoGenerator(){
				
				
				this.$router.push({path:'/paper/auto',query:{id:1}})
			},
			manualGenerator(){
				
				this.$router.push({path:'/paper/manual',query:{id:1}})
			}
			
		}



	}
</script>

<style>
</style>
